{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=106
  Verdict: Accepted
}
var s:string; i:longint;
begin
assign(input,'input.txt');
assign(output,'output.txt');
reset(input);
rewrite(output);
readln(s);
i:=0;
if s<>'' then begin
   i:=1;
   while pos(' ',s)<>0 do begin
         inc(i);
         delete(s,pos(' ',s),1);
   end;
end;
write(i);
end.